package com.juku2024.juku.db.dao

import androidx.room.*
import com.juku2024.juku.db.entity.NoteModel

@Dao
interface NoteDao {

    @Query("SELECT * FROM `note` WHERE id=:id")
    fun query(id: Long): NoteModel?

    @Query("SELECT * FROM `note` ")
    fun queryAll(): List<NoteModel>?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(adEntity: NoteModel)

    @Update
    fun update(adEntity: NoteModel)

    @Query("DELETE FROM `note` WHERE id=:id")
    fun delete(id: Long)

    @Query("DELETE FROM `note`")
    fun deleteAll()
}